from ctaf_facade.enumerations.error_code_enum import ErrorCodeEnum


class CTAFbaseException(Exception):

    def __init__(self, error_code: ErrorCodeEnum = None, error_message: str = None):
        self.error_code: str = ""
        if not error_code:
            self.error_code = error_code.value
        if not error_message:
            self.error_message: str = f"Error {self.error_code} happened!"
        else:
            self.error_message: str = error_message


class BusCallTimeoutException(CTAFbaseException):
    def __init__(self, error_message: str = None):
        super().__init__(ErrorCodeEnum.BUS_CALL_TIMEOUT, error_message)